function cmp = leaveOneOut(traindata, trainlabels, testdata, testlabels, bucketsNo)
    cmp=[];
    [trd buckets] = partitionData([trainlabels, traindata], bucketsNo);

    procRows = 0;
    for(attempt=1:bucketsNo)
        #rows to form the test set
        rowsNo = sum(buckets)(1,attempt);
        firstRow = procRows+1;
        lastRow = procRows+rowsNo;
        procRows += rowsNo;

        #these will include data prepended by labels
        forTrain = trd([1:procRows, lastRow+1:end],:);
        forTest  = trd(firstRow:lastRow,:);     
    
        params  = getDecPlane(forTrain(:,2:end), forTrain(:,1), 2);
        rateEst = verify(forTest(:,2:end),forTest(:,1), params)        
        rate    = verify(testdata, testlabels, params)
        cmp=[cmp; rateEst, rate];
    endfor;
    params  = getDecPlane(traindata, trainlabels, 2);
    rate    = verify(testdata, testlabels, params);
    cmp=[cmp; mean(cmp)(1,1),rate];
end;
